IIF (expression, truePart, falsePart)

Basic and Crystal syntax.

Argument
Returns

truePart if expression is True and falsePart if expression is False. The type of the returned value is the same as the type of truePart and falsePart.

Action

IIF returns one of two parts, depending on the evaluation of the expression.

Typical uses
Examples

The following examples are applicable to both Basic and Crystal syntax:

IIF ({Orders.Order Amount} > 10000, "large order", "standard order")

Returns the String value "large order" if {Orders.Order Amount} is more than $10,000 and the String value "standard order" otherwise.

You can insert a formula field that represents the order amount if the payment has been made already, and is 0 otherwise:

Rem Basic syntax

formula = IIF ({Orders.Payment Received}, {Orders.Order Amount}, 0)


//Crystal syntax

IIF ({Orders.Payment Received}, {Orders.Order Amount}, 0)

Comments
Related topics

Choose (index, choice1, choice2, ..., choiceN)

Switch (expr1, value1, expr2, value2, ..., exprN, valueN)

Select statements (Basic syntax)

Select expressions (Crystal syntax)



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com